package cn.chinaflame.pagodas.req;

import cn.chinaflame.pagodas.enums.CodeEnum;
import cn.chinaflame.pagodas.utils.ParamPreconditions;

import java.math.BigDecimal;

/**
 * 项目更新操作入参对象
 *
 * @author created by boming
 * @date 2018年1月5日 上午11:10:47
 */
public class ItemAddReq extends BaseReq {

    private String id;
    private String name;
    private String provinceCode;
    private String cityCode;
    private String areaCode;
    private String description;
    private String agentId;
    private BigDecimal commission;
    private String state;

    @Override
    public void check() {
        super.check();
        ParamPreconditions.checkNotEmpty(CodeEnum.FAIL.getCode(), "必要参数为空", "必要参数为空",
                name, provinceCode, cityCode, agentId, state);
        ParamPreconditions.checkNotNull(commission, CodeEnum.FAIL.getCode(), "提成不能为空");
        ParamPreconditions.checkArgument(commission.compareTo(BigDecimal.ZERO) > 0, CodeEnum.FAIL.getCode(), "提成徐大于0");
    }

    public BigDecimal getCommission() {
        return commission;
    }

    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }


}
